package reflect;

import reflect.annotation.AutoRunMethod;

import java.lang.reflect.Method;

public class ReflectDemo11 {
    public static void main(String[] args) throws Exception {
        //
        Class cls=Class.forName("reflect.Person");

        Method method=cls.getMethod("sayHello");
        boolean mask=method.isAnnotationPresent(AutoRunMethod.class);
        if (mask){
            System.out.println("该方法被注解了");
            int num=method.getParameterCount();
            int moddifier= method.getModifiers();
            String name=method.getName();
            Class returnType=method.getReturnType();
            Class[] paras=method.getParameterTypes();
        }else {
            System.out.println("该方法没有被注解");
        }

    }
}
